package com.yz.xyt.service.impl;

import com.yz.xyt.domain.Staff;
import com.yz.xyt.domain.Student;
import com.yz.xyt.mapper.StaffTmpMapper;
import com.yz.xyt.mapper.StudentTmpMapper;
import com.yz.xyt.service.IInsideSyncService;
import com.yz.xyt.service.IStaffService;
import com.yz.xyt.service.IStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * 内部同步接口
 */
@Service
public class InsideSyncServiceImpl implements IInsideSyncService {

    @Autowired
    StaffTmpMapper staffTmpMapper;
    @Autowired
    StudentTmpMapper studentTmpMapper;

    @Autowired
    IStaffService staffService;
    @Autowired
    IStudentService studentService;

    @Transactional
    @Override
    public void syncStaff() {
        staffService.syncAddStaff(staffTmpMapper.findAll());
    }

    @Transactional
    @Override
    public void syncStudent() {
        studentService.syncAddStudent(studentTmpMapper.findAll());
    }
}
